| |||
Const
| |||
|
sharedmem_name = 'EVEREST_SensorValues';
| ||
| |||
Function ExtApp_SharedMem_ReadBuffer(bu:PChar;bu_size:DWord):Boolean;
| |||
| |||
Var
| |||
|
mappedData : PChar;
| ||
|
th : THandle;
| ||
| |||
Begin
| |||
|
Result:=False;
| ||
| |||
|
th:=OpenFileMapping(FILE_MAP_READ,False,sharedmem_name);
| ||
| |||
|
If th<>INVALID_HANDLE_VALUE Then
| ||
|
Begin
| ||
|
|
mappedData:=MapViewOfFile(th,FILE_MAP_READ,0,0,0);
| |
|
|
If mappedData<>Nil Then
| |
|
|
Begin
| |
|
|
|
StrLCopy(bu,mappedData,bu_size);
|
|
|
|
If UnmapViewOfFile(mappedData) Then Result:=True;
|
|
|
End;
| |
|
|
CloseHandle(th);
| |
|
End;
| ||
End;
|